package com.demo;

import com.demo.event.DemoEvent;
import com.demo.event.DemoEvent02;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class TestApplication {
    public static final Logger logger= LoggerFactory.getLogger(TestApplication.class);
    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(TestApplication.class);
        DemoEvent demoEvent=new DemoEvent("","event01 is publish");
        DemoEvent02 demoEvent02=new DemoEvent02("","event02 is publish");
        run.publishEvent(demoEvent);
        run.publishEvent(demoEvent02);
        logger.info("============TestApplication server starting===================");
    }
}
